import { ColumnsType } from 'antd/es/table/Table';
import { Typography } from 'antd'

const { Text } = Typography
interface HouseType {
  id: number,
  pattern: string,
  area: number,
  total_price: number,
  towards: string,
  in_store: number
}
const colums: ColumnsType<HouseType> = [
  {
    title: 'ID',
    dataIndex: 'id',
  },
  {
    title: '格局',
    dataIndex: 'pattern',
  },
  {
    title: '建面(㎡)',
    dataIndex: 'area',
  },
  {
    title: '总价(万)',
    dataIndex: 'total_price'
  },
  {
    title: '房间数',
    dataIndex: 'room_count',
  },
  {
    title: '朝向',
    dataIndex: 'towards'
  },
  {
    title: '是否在售',
    dataIndex: 'in_store',
    render: (text) => text ? <Text type="success">在售</Text> : <Text type="danger">停售</Text>
  }
]

export default colums